package com.tandashi.springbootstudy01;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, KafkaAutoConfiguration.class})
@EnableScheduling
@EnableAsync
@Slf4j
public class SpringbootStudy01Application {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootStudy01Application.class, args);
        logStartup();
    }

    private static void logStartup() {
        try {
            ApplicationHome home = new ApplicationHome(SpringbootStudy01Application.class);
            String jarPath = home.getSource().getCanonicalPath();
            log.warn("startup_jar_path:{}", jarPath);
        } catch (Exception ignore) {
        }
    }

}
